package com.ruoyi.file.filter;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;

/**
 * 观察网络请求
 *
 * @author shenli
 * @version v0.1.0
 * @since 2025/10/28 16:03
 */
@Component
public class CheckNetFilter implements Filter {

  @Override
  public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
    //shenli 25-10-28 16:14 获取请求uri
    HttpServletRequest request = (HttpServletRequest) servletRequest;
    System.out.println("请求url:" + request.getRequestURL());
    filterChain.doFilter(servletRequest, servletResponse);
  }
}
